import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../pages/Home.vue'
import MyVideo from "../pages/MyVideo";
import Search from "../pages/Search";
import SignUP from "../pages/SignUP";
import LoginIn from "../pages/LoginIn";
import Setting from "../pages/Setting";
import Classify from "../pages/Classify";
import Play from "../pages/Play";
// import Play from "../pages/Play";
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home
  },
  {
    path: '/classify',
    name: 'classify',
    component: Classify

  },
  {
    path: '/my-video',
    name: 'my-video',
    component: MyVideo
  },
  {
    path: '/search',
    name: 'search',
    component: Search
  },
  {
    path: '/sign-up',
    name: 'sign-up',
    component: SignUP
  },
  {
    path: '/login-in',
    name: 'login-in',
    component: LoginIn
  },
  {
    path: '/setting',
    name: 'setting',
    component: Setting
  },
  {
    path: '/play',
    name: 'play',
    component: Play
  }
];
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}

const router = new VueRouter({
  routes
})

export default router
